package com.starinside.wp.domain;

import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import java.util.Date;

/**
 * *******************************
 * Created by Tim.
 * form com.matt
 * on 2017/7/6
 * *******************************
 */
@Table(name = "classes", uniqueConstraints = {@UniqueConstraint(columnNames = {"name", "areaId"})})
@Entity
@Data
@EqualsAndHashCode(callSuper=true)
public class Classes extends Domain {

    @Column(columnDefinition = "varchar(50) COMMENT '班级名称'")
    private String name;

    @Column(columnDefinition = "int default 0 COMMENT '满额学生数量'")
    private Integer limitNum;

    @Column(columnDefinition = "int default 0 COMMENT '开始月份'")
    private Integer beginMonth;

    @Column(columnDefinition = "int default 0 COMMENT '结束月份'")
    private Integer endMonth;

    @Column(columnDefinition = "varchar(32) COMMENT '适用对象id'")
    private String targetObjectId;

    @Column(columnDefinition = "varchar(32) COMMENT '园区id'")
    private String areaId;

    @Column(columnDefinition = "int default 1  COMMENT '班级类型 1,托班，2，早教'")
    private Integer category;

    @Column(columnDefinition = "varchar(100) COMMENT '备注信息'")
    private String remark;

    @Column(columnDefinition = "varchar(100) COMMENT '班主任名称'")
    private String inChargeTeacherName;

    @Column(columnDefinition = "varchar(32) COMMENT ' 班主任id'")
    private String inChargeTeacherId;

    @Column(columnDefinition = "datetime COMMENT '基础日期'")
    private Date baseTime;

//    public Classes merge(Classes classes) {
//        try {
//            ModelUtil.copyNotNullPropertiesExcludeId(this, classes);
//        } catch (Exception e) {
//            throw new BusinessException(ErrorCode.ENTITY_MERGE_ERROR, "拷贝属性出错");
//        }
//        return this;
//    }
}
